registerTests([
function OrderBy_Test_0()
{
	var myArray = [88, 2, 3, 2838, 1];
	var result = myArray.OrderBy();
	
	Assert.areEqual(result.length, 5);
	Assert.areEqual(result[0], 1);
	Assert.areEqual(result[1], 2);
	Assert.areEqual(result[2], 3);
	Assert.areEqual(result[3], 88);
	Assert.areEqual(result[4], 2838);
},
function OrderBy_Selector_Test_1()
{
	var myArray = [{x: 88}, {x:2}, {x:3}, {x:2838}, {x:1}];
	var result = myArray.OrderBy("o=>o.x");
	
	Assert.areEqual(result.length, 5);
	Assert.areEqual(result[0].x, 1);
	Assert.areEqual(result[1].x, 2);
	Assert.areEqual(result[2].x, 3);
	Assert.areEqual(result[3].x, 88);
	Assert.areEqual(result[4].x, 2838);
},
function OrderBy_Selector_Comparator_Test_1()
{
	var myArray = [{x: "Whoopee!"}, {x:"a"}, {x:"Chickens"}, {x:"Why Hello There!"}, {x:"??"}];
	var result = myArray.OrderBy("o=>o.x", "(a, b) => a.length>b.length?1:a.length<b.length?-1:0");
	
	Assert.areEqual(result.length, 5);
	Assert.areEqual(result[0].x, "a");
	Assert.areEqual(result[1].x, "??");
	Assert.areEqual(result[2].x, "Whoopee!");
	Assert.areEqual(result[3].x, "Chickens");
	Assert.areEqual(result[4].x, "Why Hello There!");
}
]);